<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>{$goods.goods_name}-{$lnshop_config['shop_info_store_title']}</title>
    <meta http-equiv="keywords" content="{$lnshop_config['shop_info_store_keyword']}" />
    <meta name="description" content="{$lnshop_config['shop_info_store_desc']}" />
</head>

<body>
<!--------头部开始-------------->
<include file="Public/header" />
<!--------头部结束-------------->
<link rel="stylesheet" href="__STATIC__/css/page.css" type="text/css">
<script src="__PUBLIC__/js/pc_common.js"></script>
<link rel="stylesheet" href="__STATIC__/css/jqzoom.css" type="text/css">

<link rel="stylesheet" href="__STATIC__/css/newcarts.css" type="text/css"><!-- 收货地址，物流运费 -->
<script src="__STATIC__/js/jquery.jqzoom.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<div class="layout">
    <div class="breadcrumb-area">
        <a href="/">首页</a> >>
        <foreach name="navigate_goods" key="k" item="v">
            <a  href="{:U('/Home/Goods/goodsList',array('id'=>$k))}">{$v}</a> >>
        </foreach>
        <span>{$goods.goods_name}</span>
    </div>
    <div class="layout pa-to-10" id="good-content">
        <!--商品图片轮播-->
        <div class="left-area">
            <div class="left-area-tb">
                <div class="pro-gallery-img">
                    <div class="jqzoom">
                        <img id="zoomimg" src="{$goods.goods_id|goods_thum_images=400,400}" jqimg="{$goods.goods_id|goods_thum_images=800,800}" id="bigImage" width="480px" height="480px" alt=""/>
                    </div>
                </div>
                <!-- 修改的部分-start -->
                <div class="pro-gallery-area">
                    <div class="pro-gallery-nav">
                        <a href="javascript:;" class="pro-gallery-back next-left disabled"></a>
                        <div class="pro-gallery-thumbs">
                            <ul class="small-pic" id="pro-gallerys" style="left: 0px;">
                                <foreach name="goods_images_list" item="v" key="k" >
                                    <li class="small-pic-li <if condition="$k eq 0">current</if>">
                                    <a href="javascript:void(0);">
                                        <img src="{$v|get_sub_images=$v[goods_id],60,60}" data-img="{$v|get_sub_images=$v[goods_id],400,400}" data-big="{$v|get_sub_images=$v[goods_id],800,800}">
                                    </a>
                                    </li>
                                </foreach>
                            </ul>
                        </div>
                        <a href="javascript:;" class="pro-gallery-forward next-right"></a>
                    </div>
                </div>
                <!-- 修改的部分-end -->
            </div>
        </div>
        <!--商品图片轮播 end-->

        <div class="right-area-num">
            <div class="right-area">
                <div class="right-area-le30">
                    <h1>{$goods.goods_name}</h1>
                    <!--<div class="cpxq-explain">-->
                        <!--<if condition="$flash_sale['description'] neq ''">-->
                            <!--{$flash_sale['description']}-->
                        <!--<else/>-->
                            <!--{$goods.goods_remark}-->
                        <!--</if>-->
                    <!--</div>-->
                </div>
            </div>
            <div class="right-area ma-to--1">
                <!--商品促销 start-->
                <if condition="$goods['prom_type'] eq 3">
                    <div class="bef_fo2" style="font-size:14px; background-color:#F60; color:#FFFFFF; line-height:30px; width:100%">
                        <p style="background-color:#f72862"><span style="font-size:20px; padding:0px 16px 0px 26px; vertical-align:middle; ">促销信息：{$goods['promotion']['name']} </span></p>
                        <if condition="$goods['promotion']['level_name'] neq '' ">
                            <p style="background-color:#f72862"><span style="font-size:10px; padding:0px 16px 0px 26px; vertical-align:middle; font-weight: 600 ">适用会员：{$goods['promotion']['level_name']}</span></p>
                        </if>
                    </div>

                </if>
                <!--商品促销 end-->
                <div class="right-area-le30 pa-3-0-0-30">

                    <div class="pro-promotions-area">
                        <table class="promotions-tab" width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td width="60px" align="right">价&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格：</td>
                                <td>
                                    <p class="co-red fo-si-24 ma-le-6">
                                        ￥<span class="co-red fo-si-24" id="goods_price">{$goods.shop_price}</span>
                                    </p>
                                </td>
                            </tr>
                            <if condition="($goods['shop_price'] egt ($goods['exchange_integral']/$point_rate)) AND $goods['exchange_integral'] gt 0">
                                <tr>
                                    <td width="60px" align="right">兑换积分：</td>
                                    <td>
                                        <!-- 浮点型数据和整型数据直接计算会出现误差 -->

                                        <p class="co-red fo-si-24 ma-le-6">
                                            <span class="co-red fo-si-24">{$goods['exchange_integral']}积分</span>
                                        </p>
                                    </td>
                                </tr>
                            </if>

                            <tr>
                                <td width="60px" align="right">商品编号：</td>
                                <td>
                                    <p class=" ma-le-6">{$goods.goods_sn} <a onClick="collect_goods({$goods.goods_id});" style="color:#00F;">收藏</a></p>
                                    <!--------用户评价-end---------------->
                                </td>
                            </tr>
                            <tr>
                                <td width="60px" align="right">商品评分：</td>
                                <td>
                                    <p class="ma-le-6">
                                        <span class="pf-comment"><i class="score"></i></span>
                                        &nbsp;<a href=""><span>(共&nbsp;{$goods.comment_count}&nbsp;条评论)</span></a></p>
                                </td>
                            </tr>

                            <tr>
                                <td width="60px" align="right">运&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;费：</td>
                                <td>
                                    <p class="ma-le-6">
                                        <if condition="$goods.is_free_shipping eq 1">包邮<elseif condition="$freight_free neq 0"/>满￥{$freight_free}免运费<else/>{$config_money} 元</if>
                                    </p>
                                </td>
                            </tr>
                            <tr>
                                <td width="60px" align="right">服&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;务：</td>
                                <td><p class="ma-le-6">由鲜美特商城负责发货，并提供售后服务</p></td>
                                <td>
                                    <!-- JiaThis Button BEGIN 分享商品链接-->
                                    <div class="jiathis_style">
                                        <a href="http://www.jiathis.com/share" class="jiathis jiathis_txt" target="_blank"><img src="http://v3.jiathis.com/code_mini/images/btn/v1/jiathis1.gif" border="0" /></a>
                                    </div>
                                    <script>
                                        var jiathis_config = {
                                            url:"http://{$_SERVER[HTTP_HOST]}/index.php?m=Home&c=Goods&a=goodsInfo&id={$_GET[id]}",
                                            pic:"http://{$_SERVER[HTTP_HOST]}{$goods[goods_id]|goods_thum_images=400,400}",
                                        }
                                        var is_distribut = getCookie('is_distribut');
                                        var user_id = getCookie('user_id');
                                        // 如果已经登录了, 并且是分销商
                                        if(parseInt(is_distribut) == 1 && parseInt(user_id) > 0)
                                        {
                                            jiathis_config.url = jiathis_config.url + "&first_leader="+user_id;
                                        }
                                        //alert(jiathis_config.url);
                                    </script>
                                    <script type="text/javascript" src="http://v3.jiathis.com/code_mini/jia.js" charset="utf-8"></script>
                                    <!-- JiaThis Button END 分享商品链接-->
                                </td>
                            </tr>

                        </table>
                    </div>
                </div>
            </div>
            <form name="buy_goods_form" method="post" id="buy_goods_form" >
                <div class="right-area he315 ma-to--1">
                    <!--<div class="">-->
                        <div class="d-content">
                            <?php $count_filter = count($filter_spec); ?>
                            <?php $last = end($filter_spec);?>
                            <?php $count_tr = count($last);?>
                            <foreach name="filter_spec" item="v" key="k">
                                <if condition="$count_filter eq 2 and $last neq $v">
                                    <div class="obj-leading">
                                        <div class="obj-header">
                                            <span class="obj-title">{$k}</span>
                                        </div>
                                        <div class="obj-content">
                                            <ul class="list-leading">
                                                <foreach name="v" item="v2" key="k2">
                                                <li>
                                                    <div class="unit-detail-spec-operator active" >
                                                        <input type="hidden" value="{$v2[item_id]}"/>
                                                        <a onclick="switch_spec(this);select_spec();" rel="nofollow" hidefocus="true" class="no-image <if condition='$k2 eq 0 '>selected</if>" title="{$v2}" href="javascript:;" data-spm-anchor-id="a261y.7663282.0.0">
                                                            <span class="text text-single-line">{$v2[item]}</span>
                                                            <div class="cor"></div>
                                                        </a>
                                                    </div>
                                                </li>
                                                </foreach>
                                            </ul>
                                        </div>
                                    </div>
                                <else/>
                            <div class="obj-sku">
                                <div class="obj-header">
                                    <span class="obj-title">{$k}</span>
                                </div>
                                <div class="obj-content" >
                                    <table id="item_table" class="table-sku table-sku-low">
                                        <tbody>
                                        <foreach name="item_array" item="item_v" key="item_k">
                                        <tr class="{$item_k} showtable">
                                            <td class="name">
                                                <input type="hidden" value="{$item_k}" name="goods_spec[]" />
                                                    <foreach name="item_v[item_name]" item="item_name" key="item_name_key">
                                                        <span class="{$item_name_key}">{$item_name}</span>
                                                    </foreach>
                                            </td>
                                            <td class="price1">
                                                <input type="hidden" <if condition="$goods['prom_type'] eq 1"> value="{$goods['flash_sale']['price']}"<else/>value="{$item_v[price]}"</if> name="goods_price[]"/>
                                                <span><em class="value"><if condition="$goods['prom_type'] eq 1"> {$flash_sale['price']}<else/>{$item_v[price]}</if></em><em class="price-unit">元</em></span>
                                            </td>
                                            <td class="count">
                                                <span>
                                                    <em class="value"><em class="txt">库存</em><if condition="$goods['prom_type'] eq 1">{$flash_sale['goods_num']}<else/>{$item_v[store_count]}</if></em>
                                                    <em class="unit"></em>
                                                </span>
                                            </td>
                                            <td class="amount">
                                                <div class="control">
                                                    <div class="unit-detail-amount-control">
                                                        <?php
                                                            if($goods['prom_type'] == 1) {
                                                                $buy_total_num = $flash_sale['buy_limit'];
                                                            }else{
                                                                $buy_total_num = $item_v[store_count];
                                                            }
                                                            ?>
                                                        <a onclick="switch_num_2('{$item_k}', -1, {$buy_total_num});buy_info('{$item_k}');" rel="nofollow" hidefocus="true" trace="adjust1" class="amount-down " href="javascript:;" target="_self">-</a>
                                                        <input id="goods_num_{$item_k}" type="number" value="0" class="amount-input" name="goods_num[]"  readonly>
                                                        <a onclick="switch_num_2('{$item_k}', 1, {$buy_total_num});buy_info('{$item_k}');more();" rel="nofollow" hidefocus="true" trace="adjust1" class="amount-up" href="javascript:;" target="_self">+</a>
                                                    </div>

                                                </div>
                                                <span class="no-control fd-hide" style="display: none;">缺货</span>
                                            </td>
                                        </tr>
                                        </foreach>
                                        </tbody></table>
                                    <div class="list_checked">
                                        <p class="p-box"></p>
                                        <span class="sel"> 已选清单</span><i></i>
                                    </div>
                                    <input type="hidden" id="count_tr" value="{$count_tr}"/>
                                    <if condition="$count_tr gt 3">
                                        <div class="obj-expand" style="display: block;">
                                            <a rel="nofollow" hidefocus="true" onclick="more();" >
                                               <b class="more" ></b>
                                            </a>
                                        </div>
                                    </if>
                                </div>
                            </div>
                            </if>
                            </foreach>
                            <div class="obj-list fd-hide">
                                <div class="list-total" data-fanli="false">
                                    <span><span class="value" id="total_num">0</span><span class="unit">件</span></span>
                                </div>
                                <div class="list-total" data-fanli="false">
                                    <span><span class="value" id="total_price">0.00</span><span class="price-unit">元</span></span>
                                </div>
                                <div class="list-selected">
                                    <a rel="nofollow" trace="offerdetail_click_itemlist" href="javascript:;" class="link-list" data-spm-anchor-id="a261y.7663282.0.0"><span class="link-list-txt ms-yh">已选清单<i class="icon-arrow icon-arrow-up"><em></em><span></span></i></span></a>
                                    <div class="list-info">
                                        <table id="show_selectedGoods" class="table-list">
                                            <tbody>

                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>

                            <if condition="empty($filter_spec)">
                            <div>
                                <table class="promotions-tab he40-tr-td" width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="60px" align="right">购买数量：</td>
                                    <td>
                                        <ul class="choice-colol ma-le-6">
                                            <li>
                                                <a onClick="switch_num(-1);" class="choice-number fl" title="减" style="width:24px">-</a>
                                                <input class="wi43 fl" type="text" value="1" name="goods_num" id="goods_num" readonly/>
                                                <a onClick="switch_num(1,{$goods['store_count']});" class="choice-number fl" title="加" style="width:24px">+</a>
                                            </li>
                                            <li>(库存<span class="co-red fo-si-16">{$goods['store_count']}</span>件)</li>
                                        </ul>
                                    </td>
                                </tr>

                                <!--<tr>
                                    <td align="right" style="vertical-align:top">送&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;货：</td>
                                    <td>由{$lnshop_config['shop_info_store_name']}从 全国最近点 发货，并提供售后服务。如有问题咨询在线客服~!<br/>上午08:30前完成下单下午送达,下午下单隔日第二天送达.</td>
                                </tr>-->
                                    </table>
                            </div>
                            </if>
                        </div>
                        <div class="bt">
                            <div class="join-a-shopping-cart-2 fl" id="join_cart_now">
                                <a class="jrgwc-shopping-img jrgwc-shopping-img2" onClick="javascript:Cart4({$goods.goods_id},1,1);">
                                    <span>立即购买</span>
                                </a>
                            </div>
                            <div class="join-a-shopping-cart-2 ma-le-40 fl" id="join_cart">
                                <a class="jrgwc-shopping-img2" onClick="javascript:AjaxAddCart({$goods.goods_id},1,0);">
                                    <span>加入购物车</span>
                                </a>
                            </div>
                        </div>
                </div>
                <input type="hidden" name="goods_id" value="{$goods.goods_id}" />
            </form>
        </div>
    </div>
</div>

<div style="display:none;" id="shopdilog">
    <div class="ui-popup ui-popup-modal ui-popup-show ui-popup-focus">
        <div i="dialog" class="ui-dialog">
            <div class="ui-dialog-arrow-a"></div>
            <div class="ui-dialog-arrow-b"></div>
            <table class="ui-dialog-grid">
                <tbody>
                <tr>
                    <td i="body" class="ui-dialog-body">
                        <div i="content" class="ui-dialog-content" id="content:1459321729418" style="width: 450px; height: auto;">
                            <div id="addCartBox" class="collect-public" style="display: block;">
                                <div class="colect-top">
                                    <i class="colect-icon"></i>
                                    <!--<i class="colect-fail"></i>-->
                                    <div class="conect-title">
                                        <span>添加成功</span>
                                        <div class="add-cart-btn fn-clear">
                                            <a href="javascript:;" class="ui-button ui-button-f80 fl go-shopping">继续购物</a>
                                            <a href="{:U('Home/Cart/index')}" class="ui-button ui-button-122 fl">去购物车结算</a>
                                        </div>
                                    </div>
                                </div>
                                <div id="watch">
                                    <span>购买此宝贝的用户还购买了：</span>
                                    <ul class="fn-clear buy-list">
                                        <li></li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td i="footer" class="ui-dialog-footer" style="display: none;">
                        <div i="statusbar" class="ui-dialog-statusbar" style="display: none;"></div>
                        <div i="button" class="ui-dialog-button"></div>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
<div class="layout ma-to-20 ov-hi">
    <div class="wi240 ov-hi fl">
        <div class="product-history-area">
            <div class="hi47 co-grey">
                <h3 class="fl browse-his">推荐商品</h3>
                <!--<span class="fr pa-15-16-0-0"><a class="del-dust cu-po"></a></span>-->
            </div>
            <div class="history-bott">
                <ul class="history-comm">
                    <foreach name="recommened_goods" item="v" key="k" >
                        <li>
                            <div>
                                <p class="p-img-comm fl">
                                    <a href="{:U('Home/Goods/goodsInfo',array('id'=>$v[goods_id]))}"><img class="img-comm" src="{$v.goods_id|goods_thum_images=60,60}" alt=""></a>
                                </p>
                                <p class="p-name-comm">
                                    <a href="{:U('Home/Goods/goodsInfo',array('id'=>$v[goods_id]))}">{$v.goods_name}</a>
                                </p>
                                <p class="p-price-comm">
                                    <b>¥{$v.shop_price}</b>
                                </p>
                            </div>
                        </li>
                    </foreach>
                </ul>
            </div>
        </div>
    </div>
    <div class="wi940 ov-hi fr">
        <div class="comm-param">
            <div class="parame-title">
                <div class="par-titles co-grey">
                    <ul class="commodity-xq tab_li">
                        <li class="current cliks" onClick="switch_tab(this,'tab1')">
                            <a>商品详情</a>
                        </li>
                        <li class="cliks" onClick="switch_tab(this,'tab2')">
                            <a>用户评价（{$commentStatistics['c0']}）</a>
                        </li>
                        <li class="cliks" onClick="switch_tab(this,'tab3')">
                            <a>规格参数</a>
                        </li>
                        <li class="cliks" onClick="switch_tab(this,'tab4')">
                            <a>售后服务</a>
                        </li>
                    </ul>
                </div>
            </div>
            <!-------------------商品详情------------------>
            <div class="parame-bott cliks-bn" style="display:" id="tab1">
                <div class="commodity-num pro-feature-area">
                    <div class="pro-disclaimer-area ma-to-20">
                        {$goods.goods_content|htmlspecialchars_decode}
                    </div>
                </div>
            </div>
            <!-------------------规格参数------------------>
            <div class="parame-bott cliks-bn" style="display:none"  id="tab3">
                <div class="commodity-num pro-feature-area wi850">
                    <table class="modity-zhut" width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <th colspan="2"><h3>商品属性</h3></th>
                        </tr>
                        <foreach name="goods_attr_list" item="v" key="k" >
                            <tr>
                                <td class="wi143">{$goods_attribute[$v[attr_id]]}</td>
                                <td class="pa-5-0">{$v[attr_value]}</td>
                            </tr>
                        </foreach>
                    </table>
                </div>
            </div>
            <!-------------------售后服务------------------>
            <div class="parame-bott cliks-bn" style="display:none"  id="tab4">
                <div class="commodity-num pro-feature-area wi850 padding36-0-36-0">
                    {$after_sale[content]|htmlspecialchars_decode}
                </div>
            </div>
            <!-------------------用户评价------------------>
            <div class="parame-bott ov-hi" style="display:none"  id="tab2">
                <div class="evaluation-top fo-fa di-in-bl">
                    <div class="eval-le1 fl wi146 te-al">
                        <span><b>{$commentStatistics['rate1']}</b>%</span>
                        <em>好评度</em>
                    </div>
                    <div class="eval-le2 fl wi123 pa-to-7">
                        <dl>
                            <dt>好评<em>({$commentStatistics['rate1']}%)</em></dt>
                            <dd><s style=" width:94%"></s></dd>
                        </dl>
                        <dl>
                            <dt>中评<em>({$commentStatistics['rate2']}%)</em></dt>
                            <dd><s style=" width:2%"></s></dd>
                        </dl>
                        <dl>
                            <dt>差评<em>({$commentStatistics['rate3']}%)</em></dt>
                            <dd><s style=" width:4%"></s></dd>
                        </dl>
                    </div>
                    <div class="eval-le3 fl wi516">
                        <dl>
                            <dt>买家评论事项：购买后有什么问题, 满意, 或者不不满, 都可以在这里评论出来, 这里评论全部源于真实的评论.</dt>
                        </dl>
                    </div>
                    <div class="eval-le4 fl wi150 pa-to-43 te-al">
                        <a href="{:U('Home/User/comment')}">发表评价</a>
                    </div>
                </div>
                <div class="evaluation-cen fo-fa">
                    <div class="eval-cen-le fl pa-le-12">
                        <ul>
                            <li class="curres cliks">
                                <a href="javascript:void(0);" data-t='1'>
                                                <span>
                                                    全部评价
                                                    <em>({$commentStatistics['c0']})</em>
                                                </span>
                                </a>
                            </li>
                            <li class="cliks">
                                <a href="javascript:void(0);" data-t='2'>
                                                <span>
                                                    好评
                                                    <em>({$commentStatistics['c1']})</em>
                                                </span>
                                </a>
                            </li>
                            <li class="cliks">
                                <a href="javascript:void(0);" data-t='3'>
                                                <span>
                                                    中评
                                                    <em>({$commentStatistics['c2']})</em>
                                                </span>
                                </a>
                            </li>
                            <li class="cliks">
                                <a href="javascript:void(0);" data-t='4'>
                                                <span>
                                                    差评
                                                    <em>({$commentStatistics['c3']})</em>
                                                </span>
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
                <!--------用户评价-start--------------->
                <!--<link rel="stylesheet" href="/Public/bootstrap/css/bootstrap.min.css" type="text/css">--->
                <div class="evaluation-bott pa-to-25 cliks-bn" style="display:block" id="ajax_comment_return">
                    <!--ajax 然后分页数据-->
                </div>
                <script>
                    $(document).ready(function(){
                        commentType = 1; // 评论类型
                        ajaxComment(1,1);// ajax 加载评价列表
                    });

                    // 好评差评 切换
                    $(".eval-cen-le a").click(function(){
                        $(".eval-cen-le li").removeClass('curres');
                        $(this).parent().addClass('curres');
                        commentType = $(this).data('t');// 评价类型   好评 中评  差评
                        ajaxComment(commentType,1);
                    });

                    // 用ajax分页显示评论
                    function ajaxComment(commentType,page){
                        $.ajax({
                            type : "GET",
                            url:"/index.php?m=Home&c=Goods&a=ajaxComment&goods_id={$goods['goods_id']}&commentType="+commentType+"&p="+page,//+tab,
                            success: function(data){
                                $("#ajax_comment_return").html('');
                                $("#ajax_comment_return").append(data);
                            }
                        });
                    }
                </script>
                <!--------用户评价-end---------------->
            </div>
        </div>
        <div class="comm-param">
            <div class="parame-title">
                <div class="par-titles co-grey">
                    <ul class="commodity-xq ask_tab_li consult_ul">
                        <li class="current cliks">
                            <a data-t='0'>全部咨询</a>
                        </li>
                        <li class="cliks">
                            <a data-t='1'>商品咨询</a>
                        </li>
                        <li class="cliks">
                            <a data-t='2'>支付</a>
                        </li>
                        <li class="cliks">
                            <a data-t='3'>配送</a>
                        </li>
                        <li class="cliks">
                            <a data-t='4'>售后</a>
                        </li>
                    </ul>
                </div>
            </div>
            <!-------------------咨询列表----------------->
            <div class="parame-bott cliks-bn" style="display:block" id="ask_tab1">
                <div class="commodity-num" id="ajax_consult_return">
                    <!--ajax return-->
                </div>
            </div>
            <script>
                $(document).ready(function(){
                    consult_type = 0; // 咨询类型
                    ajaxConsult(consult_type,1);// ajax 加载咨询列表
                });
                // 咨询类型切换
                $(".consult_ul a").click(function(){
                    $(".consult_ul li").removeClass('current');
                    $(this).parent().addClass('current');
                    consult_type = $(this).data('t');// 咨询类型 商品咨询 支付咨询 配送咨询 售后咨询
                    ajaxConsult(consult_type,1);
                });

                // 用ajax分页显示咨询
                function ajaxConsult(consult_type,page){
                    $.ajax({
                        type : "GET",
                        url:"/index.php?m=Home&c=Goods&a=ajax_consult&goods_id={$goods['goods_id']}&consult_type="+consult_type+"&p="+page,//+tab,
                        success: function(data){
                            $("#ajax_consult_return").html('');
                            $("#ajax_consult_return").append(data);
                        }
                    });
                }
            </script>
            <!-------------------咨询列表-end---------------->
            <!-------------------发表咨询------------------>
            <div class="parame-bott ma-to--21">
                <div class="commodity-num">
                    <div class="spxqer-top-t">
                        <h3 class="spxqer-topt-h3">发表咨询</h3>
                    </div>
                    <div class="spxqer-cen">
                        <div class="spxqer-top pa-17-0-14">
                            <span class="colo-ora">温馨提示：</span>
                            因产线可能更改商品包装、产地、附配件等未及时通知，且每位咨询者购买、提问时间等不同。为此，客服给到的回复仅对提问者3天内有效，其他网友仅供参考！给您带来的不便还请谅解，谢谢！
                        </div>
                        <div class="form-edit-area">
                            <form action="{:U('Home/Goods/goodsConsult')}" method="post" id="form_consult" name="form_consult" onSubmit="return check_form_consult(this);">
                                <div class="form-table">
                                    <p>
                                        <b>商品咨询：</b>
                                        <input type="radio" name="consult_type" value="1" checked /><label for="">商品咨询</label>
                                        <input type="radio" name="consult_type" value="2" /><label for="">支付</label>
                                        <input type="radio" name="consult_type" value="3" /><label for="">配送</label>
                                        <input type="radio" name="consult_type" value="4" /><label for="">售后</label>
                                    </p>
                                    <p>网&nbsp;名:<input type="text" name="username" id="username" placeholder="请输入网名" /></p>
                                    <p>内&nbsp;容:<textarea name="content" id="content"  class="textarea"></textarea></p>
                                    <p>
                                        验证码:<input  type="text" name="verify_code" placeholder="不区分大小写"/>
                                        <img  id="verify_code" width="80" height="40" src="/index.php?m=Home&c=Index&a=verify&type=consult&fontSize=20&length=4" />
                                        <a><img  src="__STATIC__/images/chg_image.png"  onclick="verify(this)" /></a>
                                    </p>
                                </div>
                                <div class="form-butt">
                                    <input type="hidden" name="goods_id" id="goods_id"  value="{$goods['goods_id']}"/>
                                    <input type="submit" class="bu-tj" value="提交">
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <script>
                // 商品咨询表单验证
                function check_form_consult(f){
                    if($.trim($('input[name="username"]').val()).length == 0)
                    {
                        layer.msg('请填写一个网名', {
                            icon: 1,   // 成功图标
                            time: 2000 //2秒关闭（如果不配置，默认是3秒）
                        });

                        return false;
                    }
                    if($.trim($('textarea[name="content"]').val()).length == 0)
                    {

                        layer.msg('请填输入咨询内容', {
                            icon: 1,   // 成功图标
                            time: 2000 //2秒关闭（如果不配置，默认是3秒）
                        });
                        return false;
                    }
                    if($.trim($('input[name="verify_code"]').val()).length == 0)
                    {
                        layer.msg('请填输入验证码', {
                            icon: 1,   // 成功图标
                            time: 2000 //2秒关闭（如果不配置，默认是3秒）
                        });
                        return false;
                    }
                    return true;
                }
            </script>
            <!-------------------发表咨询 end----------------->
        </div>
    </div>
</div>

<script>
    $(function () {
        var $count_tr = $('#count_tr').val();
        if($count_tr >= 3){
            $('.obj-content').css('border-bottom','1px solid #eee');
        }
        $('#item_table tr').eq(2).addClass('show_index');
    });
    var flag = true;
    var more_flag = true;
    function more() {
        $('#item_table tr').eq(2).removeClass('border-style');
        if(flag){
            var len_attr = $('.showtable_line').length;
            var len = $('.showtable').length;
            if(len_attr > 0){
                $('.showtable_line').eq(2).removeClass('show_index');
                $('.showtable_line').eq(len_attr-1).removeClass('showtable_line').addClass('border-style');
                var height_attr = (580+(len_attr-3)*65);
                $('#good-content').css('height',height_attr+'px');
                flag = false;
                more_flag = false;
            }else{
                $('.showtable').eq(2).removeClass('show_index');
                $('.showtable').eq(len-1).removeClass('showtable_line').addClass('border-style');
                var height = (580+(len-3)*65);
                $('#good-content').css('height',height+'px');
                flag = false;
            }

        }
        $(".table-sku").removeClass('table-sku-low');
        $(".obj-expand").css('display','none');
    }
    $(".amount-up").click(function(){
        $(".more").css('display','none');
        $(".obj-list").css('display','inline-block');
        $(".obj-list").css('background','#f7f7f7');
        $(".obj-list").css('width','100%');
        $(".obj-content").css('border','0px');
    })
    $(".list-selected").click(function(){
        if($(".list-selected").hasClass("list-selected-expand")){
            $(".list-selected").removeClass("list-selected-expand");
        }else{
            $(".list-selected").addClass("list-selected-expand");
        }
    })



    $(document).ready(function(){
        // 更新商品价格
        select_spec();
        //get_goods_price();
        $(".jqzoom").jqueryzoom({
            xzoom: 480,
            yzoom: 480,
            offset: 30,
            position: "right",
            preload: 1,
            lens: 1
        });

        var uname= getCookie('uname');
		uname = decodeURI(uname);
        $("#username").val(uname);
    });

    /**
     * 切换规格
     */
    function switch_spec(spec)
    {
        //$(spec).siblings('input').trigger('click');	 // 让隐藏的 单选按钮选中
        $(spec).parent().parent().parent().find("div a").removeClass('selected'); //   清空勾选图标
        $(spec).addClass('selected'); // 当前 加上勾选图标

        // 更新商品价格
        //get_goods_price();
    }
    /**
     * 选择规格方法
     */
    function select_spec(){
        //规格信息
        var spec_id = 0;//$(obj).parent().find("input").val();
        $(".unit-detail-spec-operator a").each(function(key, value){
            if($(this).hasClass('selected')){
                spec_id = $(this).parent().find("input").val();
            }
        });
        var show_index = 0;
        if(spec_id != 0){
            $("#item_table tr").each(function(key, value){
                var class_str = $(this).attr("class");
                //截取class中的规格信息
                var spec_len = class_str.indexOf(' ', 1);
                if(spec_len != -1){
                    class_str = class_str.substring(0, spec_len);
                }
                //显示选中规格对应商品信息
                var class_arr = class_str.split("_");
                if($.inArray(spec_id, class_arr) < 0){
                    $(this).css("display", "none");
                    $(this).removeClass('showtable_line');
                }else{
                    $(this).css("display", "block");
                    $(this).css("line-height", "44px");
                    show_index++;
                    $(this).addClass('showtable_line');
//                    alert(show_index);
                    if(show_index == 3){
                        $(this).addClass('show_index');
                    }else{
                        $(this).removeClass('show_index');
                    }

                }

                $('#item_table tr .name span').each(function(key, value){
                    var item_span = $(this).attr("class");
                    if(item_span == spec_id){
                        $(this).css('display', 'none');
                    }
                })
            });
            if(show_index <= 3){
                $('.obj-content').css('border','0px');
                $('.obj-expand').css('display', 'none');
            }else{
                if(more_flag){
                    $('.obj-content').css('border-bottom','1px solid #eee');
                    $('.obj-expand').css('display', 'block');
                }else{
                    var showtable_len =  $('.showtable_line').length;
                    $('.showtable_line').eq(2).removeClass('show_index');
                    $('.showtable_line').eq(showtable_len-1).removeClass('showtable_line').addClass('border-style');
                    var height_attr1 = (580+(showtable_len-3)*65);
                    $('#good-content').css('height',height_attr1+'px');
                }

            }

        }
    }

    //加入清单
    function buy_info(item_k){

        $.ajax({
            type : "POST",
            dataType : "json",
            data : $('#buy_goods_form').serialize(),
            url : "/index.php?m=Home&c=Goods&a=ajaxGoodsInfoCache",
            success : function(data){
                if(data.status<0){
                    layer.alert(data.msg, {icon: 2});
                    var num2 = parseInt($("#goods_num_" + item_k).val());
                    num2 -= 1;
                    if(num2 < 0) num2 = 0; // 保证购买数量不能少于 0
                    $("#goods_num_"+ item_k).val(num2);
                }else{
                    var goodsInfo = data.data;
                    $('#total_num').html(goodsInfo.total_num);
                    $('#total_price').html(goodsInfo.total_price);
                    var goodsData = goodsInfo.goods_info;

                    var tr_str = "";
                    $.each(goodsData, function(val, index){
                        tr_str += '<tr data-name="';
                        tr_str += val;
                        tr_str += '">';
                        tr_str += '<td class="prop">';
                        tr_str += val;
                        tr_str += '</td>';
                        tr_str += '<td class="amount"> <span class="value">';
                        tr_str += index.goods_num;
                        tr_str += '</span><span class="unit">件</span> </td> <td class="desc"> <ul>';
                        $.each(index, function(val2, index2){
                            if(index2){
                                tr_str += '<li>';
                                if(index2.second_item){
                                    tr_str += '<span class="name">';
                                    tr_str += index2.second_item;
                                    tr_str += '</span>';
                                }
                                if(index2.num){
                                    tr_str += '<span class="no-control">（<em class="value">';
                                    tr_str += index2.num;
                                    tr_str += '</em>）件</span>';
                                }
                                tr_str += ' </li>';
                            }
                        })
                        tr_str += '</ul> </td> </tr>';
                    });

                    $('#show_selectedGoods').html('');
                    $('#show_selectedGoods').html(tr_str);

                }
            }
        });
    }

    /**
     * 购买商品数量加加减减
     */
    function switch_num(num, score_count)
    {
        var num2 = parseInt($("#goods_num").val());
        num2 += num;
        if(num2 < 1) num2 = 1; // 保证购买数量不能少于 1
        if(num2 > score_count) num2 = score_count;  //保证购买数量不能多于 库存数量
        $("#goods_num").val(num2); // 修改商品购买数量
        // 更新商品价格
        //get_goods_price();
    }

    /**
     * 购买商品数量加加减减
     */
    function switch_num_2(id, num, score_count)
    {
        var num2 = parseInt($("#goods_num_"+id).val());
        num2 += num;
        if(num2 < 0) num2 = 0; // 保证购买数量不能少于 0
        if(num2 > score_count) num2 = score_count;  //保证购买数量不能多于 库存数量
        $("#goods_num_"+id).val(num2); // 修改商品购买数量
        // 更新商品价格
        //get_goods_price();
    }
    // 用作 sort 排序用
    function sortNumber(a,b)
    {
        return a - b;
    }
    /*** 查询商品价格*/
    function get_goods_price()
    {

        var goods_price = {$goods.shop_price}; // 商品起始价
        var store_count = {$goods.store_count}; // 商品起始库存

        var spec_goods_price = {$spec_goods_price};  // 规格 对应 价格 库存表   //alert(spec_goods_price['28_100']['price']);
        // 如果有属性选择项
        if(spec_goods_price != null)
        {
            goods_spec_arr = new Array();
            $("input[name^='goods_spec_']:checked").each(function(){
                goods_spec_arr.push($(this).val());
            });
            var spec_key = goods_spec_arr.sort(sortNumber).join('_');  //排序后组合成 key
            goods_price = spec_goods_price[spec_key]['price']; // 找到对应规格的价格
            store_count = spec_goods_price[spec_key]['store_count']; // 找到对应规格的库存
        }

        var goods_num = parseInt($("#goods_num").val());
        // 库存不足的情况
        if(goods_num > store_count)
        {
            goods_num = store_count;
            layer.msg('库存仅剩 '+store_count+' 件', {icon: 2}); //alert('库存仅剩 '+store_count+' 件');
            //$("#goods_num").val(goods_num);
        }

        var flash_sale_price = parseFloat("{$goods['flash_sale']['price']}");
        (flash_sale_price > 0) && (goods_price = flash_sale_price);

        $("#goods_price").html(goods_price); // 变动价格显示
    }

    /**
     * 切换 商品详情  用户评价  规格参数  包装清单  售后服务
     */
    function switch_tab(cur,tab)
    {
        $("#tab1,#tab2,#tab3,#tab4").hide(); // 先全部隐藏
        $("#"+tab).show();	// 再显示其中一个
        $("ul.tab_li li").removeClass("current"); // 先全部样式去除
        $(cur).addClass("current"); //  单独的给当前点击这个加上
    }

    // 验证码切换
    function verify(){
        $('#verify_code').attr('src','/index.php?m=Home&c=Index&a=verify&type=consult&fontSize=20&length=4&r='+Math.random());
    }

    //缩略图切换
    $('.small-pic-li').each(function(i,o){
        var lilength = $('.small-pic-li').length;
        $(o).hover(function(){
            $(o).siblings().removeClass('current');
            $(o).addClass('current');
            $('#zoomimg').attr('src',$(o).find('img').attr('data-img'));
            $('#zoomimg').attr('jqimg',$(o).find('img').attr('data-big'));
            if(i==0){
                $('.next-left').addClass('disabled');
            }
            if(i+1==lilength){
                $('.next-right').addClass('disabled');
            }
        });
    })

    //前一张缩略图
    $('.next-left').click(function(){
        var newselect = $('.small-pic>.current').prev();
        $('.small-pic-li').removeClass('current');
        $(newselect).addClass('current');
        $('#zoomimg').attr('src',$(newselect).find('img').attr('data-img'));
        $('#zoomimg').attr('jqimg',$(newselect).find('img').attr('data-big'));
        var index = $('.small-pic>li').index(newselect);
        if(index==0){
            $('.next-left').addClass('disabled');
        }
        $('.next-right').removeClass('disabled');
    })

    //后前一张缩略图
    $('.next-right').click(function(){
        var newselect = $('.small-pic>.current').next();
        $('.small-pic-li').removeClass('current');
        $(newselect).addClass('current');
        $('#zoomimg').attr('src',$(newselect).find('img').attr('data-img'));
        $('#zoomimg').attr('jqimg',$(newselect).find('img').attr('data-big'));
        var index = $('.small-pic>li').index(newselect);
        if(index+1 == $('.small-pic>li').length){
            $('.next-right').addClass('disabled');
        }
        $('.next-left').removeClass('disabled');
    })
</script>

<!--------收货地址，物流运费-开始-------------->
<script src="__STATIC__/js/location.js"></script>
<!--------收货地址，物流运费--结束-------------->

<script src="__PUBLIC__/js/jqueryUrlGet.js"></script><!--获取get参数插件-->
<script> set_first_leader(); //设置推荐人 </script>

<!--------footer-开始-------------->
<include file="Public/footer" />
<!--------footer-结束-------------->
</body>
</html>
